/**
 * @author wly
 * @version V1.0.0
 * @date 2023/3/16 18:17
 * 求最大公约数
 */
public class exr02 {
    public static void main(String[] args) {
        System.out.println(gcd(16, 142));
    }

    static int gcd(int a,int b){
//        if(b == 0) return a;
//        else return gcd(b , a % b);
        while (a % b != 0){
            int res = a % b;
            a = b;
            b = res;
        }
        return b;
    }
}
